#include<stdio.h>
int main() {
    //有序数组去重操作
	int nums[] = { 0,0,1.2,2,2,3,3,4 };//升序数组
	int dest = 0, i = 0, j = 1;
	int length = sizeof(nums) / sizeof(int);
	while (j < length) {
		if (nums[i] == nums[j]) {
			j++;
		}
		else {
			nums[dest] = nums[i];
			dest++;
			i = j;
			j++;
		}
	}
    //j越界，循环结束，将最后一个nums[i]赋值给nums[dest]
	nums[dest] = nums[i];
	dest++;
	for (int k = 0; k < dest; k++) {
		printf("%d ", nums[k]);
	}
}